home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: netcom.com!cader
- From: cader@netcom.com (Charles Ader)
- Subject: Re: How to test a random generator ?
- Message-ID: <caderDLrHrt.2z5@netcom.com>
- Organization: NETCOM On-line Communication Services (408 261-4700 guest)
- X-Newsreader: TIN [version 1.2 PL1]
- References: <4e2q7g$oe@centre.univ-orleans.fr> <4e933p$t25@longwood.cs.ucf.edu>
- Date: Fri, 26 Jan 1996 00:09:29 GMT
- Sender: cader@netcom3.netcom.com
-
- The tests used to validate a random number generator (RNG) depend
- on just what the RNG is to be used for. An algorithmic RNG is not
- recommended for cryptographic use. True randomness is best derrived
- from some physical source (keyboard typeing measured in milliseconds,
- thermal noise from a diode junction, radiation particle decay).
-
- Algorithmic RNG are also called Pseudo random sequence generators.
- The best ones exhibit a uniform dispersion of digits over the
- range you intend to use. So if you want to validate a RNG
- over the range of 0-19 run your RNG for several million
- calls and build a 20 bin histogram of the results, if any bin
- accumulates more than the others your distribution is skewed.
- The key to this type of test is to make sure that the RNG
- cycles through all of its possible states several times.
-
- Charles.
-